﻿using System;

public class d2
{
    public static void Main(string[] args)
    {
        List<int> list = new List<int>();
        Random random = new Random();
        for(int i=0;i<100;i++)
        {
            list.Add(random.Next(1000));
        }

        for(int i=0;i<100;i++)
        {
            Console.WriteLine(list[i]);
        }
        var query=from i in list orderby i select i;
        List<int> list2 = query.ToList();
        int sum=query.Sum();
        double avg=query.Average();
        Console.WriteLine("query:-------------------------");
        for (int j=0;j<list2.Count;j++)
        {
            Console.WriteLine(list2[j]);
        }
        Console.WriteLine($"sum:{sum}");
        Console.WriteLine($"average:{avg}");
    }
}